import request from '@/utils/request'

// 用户增长分析
export function getUserGrowth(params) {
  return request({
    url: '/analytics/user-growth',
    method: 'get',
    params
  })
}

// 用户留存率分析
export function getRetentionRate(params) {
  return request({
    url: '/analytics/retention-rate',
    method: 'get',
    params
  })
}

// 阅读时长分析
export function getReadingTimeAnalysis(params) {
  return request({
    url: '/analytics/reading-time',
    method: 'get',
    params
  })
}

// 作者数据分析
export function getAuthorAnalytics(params) {
  return request({
    url: '/analytics/author-performance',
    method: 'get',
    params
  })
}

// 读者画像分析
export function getReaderDemographics(params) {
  return request({
    url: '/analytics/reader-demographics',
    method: 'get',
    params
  })
}

// 收入统计
export function getRevenueStats(params) {
  return request({
    url: '/analytics/revenue',
    method: 'get',
    params
  })
}

// 服务器状态监控
export function getServerStatus() {
  return request({
    url: '/monitoring/server-status',
    method: 'get'
  })
}

// 用户行为监控
export function getUserBehavior(params) {
  return request({
    url: '/monitoring/user-behavior',
    method: 'get',
    params
  })
}

// 获取系统警报
export function getSystemAlerts(params) {
  return request({
    url: '/monitoring/alerts',
    method: 'get',
    params
  })
}

// 处理警报
export function handleAlert(alertId, action) {
  return request({
    url: '/monitoring/alerts/' + alertId,
    method: 'post',
    data: { action }
  })
} 